package com.wooophone.common.util;

public class MatcheUtil {
	/** Email正则表达式 */
	public static final String REGEX_EMAIL = "^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$";
	/** URL正则表达试 */
	public static final String REGEX_URL = "(http|ftp|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&amp;:/~\\+#]*[\\w\\-\\@?^=%&amp;/~\\+#])?";

	/**
	 * Email正则表达式匹配
	 * @param email
	 * @return
	 */
	public static boolean matcheEmail(String email) {
		return email.matches(REGEX_EMAIL);
	}

	/**
	 * URL正则表达试匹配
	 * @param url
	 * @return
	 */
	public static boolean matcheUrl(String url) {
		return url.matches(REGEX_URL);
	}
}
